<?php

namespace app\api\controller;

use app\admin\model\Medicament AS MedicamentMdl;

class Medicament extends BaseController
{

    /**
     * 获取药剂
     */
    public function getMedicaments()
    {
        $param = self::getHttpParam();

        $where = [];

        $model = new MedicamentMdl();
        $fields = 'id, name, applyHarm, isAddwater';
        $order = 'createDate DESC';
        $result = $model->where($where)->field($fields)->order($order)->select();
        if (!$result) {
            return show(config('status.ERROR_STATUS'), self::NOT_DATA, '没有相关药剂');
        }

        return show(config('status.SUCCESS_STATUS'), self::MSG_SUCCESS, $result);
    }

}